/*
 * @(#)Content.java 0.0.1-SNAPSHOT
 *
 * Copyright Group B
 */

package grupb.upf.ms.impl;

import grupb.upf.ms.DescriptionContent;
import java.io.Serializable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * <p>This component implements a Content Interface. In this case,
 * it cointains a primary content and the description.</p>
 *
 * @version    0.0.1-SNAPSHOT
 * @author     Group B
 */

public final class Content implements grupb.upf.ms.Content, Serializable {

    /**
     * The logger. A new logger <code>grupb.upf.ms.Content</code> is created to
     * add the logs of this Content.
     */
    private static final Log LOG = LogFactory.getLog(Content.class);
    /**
     * The serialVersionUID is created to be able to serialize this class, it's
     * necessary because it will be sent.
     */
    private static final long serialVersionUID = 1L;
    /**
     * The content.
     */
    private Object c;
    /**
     * The description of the content.
     */
    private DescriptionContent des;

    /**
     * This is the constructor method, which let us to create and introduce
     * the content and the description.
     * @param content the content, which can be a Photo, Video...
     * @param description the DescriptionContent, which stores different
     * properties of the content
     */
    public Content(final Object content, final DescriptionContent description) {
        this.c = content;
        this.des = description;
    }

    /**
     * This method let us to set a content (Photo, Video...).
     * @param content the content, which can be a Photo, Video...
     */
    @Override
    public void setContent(final Object content) {
        this.c = content;
    }

    /**
     * This method let us to get the Content (Photo, Video...).
     * @return the Object Content (Photo, Video...)
     */
    @Override
    public Object getContent() {
        return this.c;
    }

    /**
     * This method let us to add a description to a content.
     * @param description The content properties
     */
    @Override
    public void setDescriptionContent(final DescriptionContent description) {
        this.des = description;
    }

    /**
     * This method let us to get the description of a content.
     * @return The description of the content, which stores properties of it
     */
    @Override
    public DescriptionContent getDescriptionContent() {
        return this.des;
    }
}
